SPEED=$1
BUFFER_SIZE=$2
mmdelay=$3
mmloss=$4
cc_name=$5

dst=$6

echo $SPEED $BUFFER_SIZE $mmdelay $cc_name


sudo sysctl -w net.ipv4.tcp_congestion_control=${cc_name}
sudo sysctl -a | grep net.ipv4.tcp_congestion_control

sudo ethtool -K ingress gso off
sudo ethtool -K ingress tso off
sudo sysctl -w net.ipv4.tcp_sack=0

sudo ifconfig ingress mtu 1500 up

sudo tcpdump -i ingress -s 61 dst ${dst} or src ${dst} -w mahimahi_${SPEED}_${BUFFER_SIZE}_${mmdelay}_${mmloss}_${cc_name}.pcap  &

sleep 1
iperf3 -c ${dst} -t 30

sudo pkill -9 iperf3
sleep 1
sudo pkill -9 tcpdump
